import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectionDB {

	public static void closeConnectionDataBase(Connection myBaseCon) {

		try {
			if (myBaseCon != null && !myBaseCon.isClosed()) {
				myBaseCon.close();
			}
		} catch (final SQLException e) {
			e.printStackTrace();
		}
	}

	public static Connection getConnectonData() {
		final String DRIVER = "jdbc:odbc:MBankDataBase";
		

		Connection myBaseCon = null;

		try {
			//
			Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
		try {
			myBaseCon = DriverManager.getConnection(DRIVER);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return myBaseCon;

	}

}
